
<?php
$committee = $this->params['controller'];
if (!empty($controller)){
    $committee = $controller;
}
if($auth_user['User']['superuser'] || (!empty($permission['Secretariat']))||(!empty($permission['secretariat1']))||(isset($permission['Edit']) && $permission['Edit'])) {
    echo '<td class="actions" width="3.5%">';
    echo  $html->link($html->image('icons/edit.gif',array('alt'=>__('Edit item',true),'title'=>__('Edit item',true))),array('committee'=>$dcommittee['Committee']['short_name'],'controller'=>$committee,'action'=>'edit','id'=>$crudid),array('escape'=>false));
    echo '</td>';
}elseif(isset($permission['edit']) && $permission['edit']>0 ||(isset($permission['secretariat']) && $permission['secretariat'])){
    echo '<td class="actions" width="3.5%">&nbsp;</td>';
}

if($this->params['controller']!='items') {
    if($auth_user['User']['superuser'] || (!empty($permission['Secretariat']))|| (!empty($permission['secretariat1']))||(isset($permission['Delete']) && $permission['Delete'])){
        echo '<td class="actions" width="3.5%">';
        echo $html->link($html->image('icons/delete.gif', array('alt'=>__('Delete item',true),'title'=>__('Delete item',true))),array('committee'=>$dcommittee['Committee']['short_name'],'controller'=>$committee,'action'=>'delete','id'=>$crudid), array('escape'=>false),sprintf(__('Are you sure you want to delete this item?', true), $crudid));
        echo '</td>';
    }elseif(isset($permission['delete']) && $permission['delete']>0 ||(isset($permission['secretariat']) && $permission['secretariat'])){
        echo '<td class="actions" width="3.5%">';
        echo '&nbsp;';
        echo '</td>';
    } 
} else{
if((isset($permission['Delete']) && $permission['Delete'])){
        echo '<td class="actions" width="3.5%">';
        echo $html->link($html->image('icons/delete.gif', array('alt'=>__('Delete item',true),'title'=>__('Delete item',true))),array('committee'=>$dcommittee['Committee']['short_name'],'controller'=>$committee,'action'=>'delete','id'=>$crudid), array('escape'=>false),sprintf(__('Are you sure you want to delete this item?', true), $crudid));
        echo '</td>';
    }elseif(isset($permission['delete']) && $permission['delete']>0 ){
        echo '<td class="actions" width="3.5%">';
        echo '&nbsp;';
        echo '</td>';
    } 
}
?>
